@extends('wx.layout.default')

@section('wx.pheader')
  @include('wx.layout.swiper')
@stop

@section('wx.pbody')

  <div class="weui-cells">
    <div class="weui-cell weui-cell_access">
      <div class="weui-cell__bd">
        <p>班级花名册({{$publish->name}})</p>
      </div>
    </div>
  </div>
  <div class="weui-cells weui-grids" style="margin-top:0;">
    @if(!!$publish)
      @foreach($publish->details as $detail)
      <a href="{{route('wx.settle.confirm',$detail->id)}}" class="weui-grid">
        <div class="weui-grid__label">
          {{$detail->category->name}}
        </div>
        <p class="weui-grid__label b bigger-110" style="margin:8px 0 0;">
          {{$detail->clase->name}}
        </p>
        @if( $user->isJoin($publish->id,$detail->clase->id) )
        <div class="join-status"><img src="/assets/images/join.fw.png" /></div>
        @endif
      </a>
      @endforeach
    @endif
  </div>

  <div class="weui-cells">
    <a href="javascript:;" class="weui-cell weui-cell_access">
      <div class="weui-cell__hd"><i class="iconfont">&#xe686;</i></div>
      <div class="weui-cell__bd">
        <p>我的班级</p>
      </div>
      <div class="weui-cell__ft">{{$user->student->count()}}</div>
    </a>
    <a href="javascript:;" class="weui-cell weui-cell_access">
      <div class="weui-cell__hd"><i class="iconfont">&#xe686;</i></div>
      <div class="weui-cell__bd">
        <p>信息修改</p>
      </div>
      <div class="weui-cell__ft"></div>
    </a>
  </div>


  <div class="weui-btn-area" style="margin-bottom: 0;">
    <a href="{{route('wx.settle.logout')}}" class="weui-btn weui-btn_default">退出</a>
  </div>

@stop

@section('javascript')
  <script src="//cdn.bootcss.com/jquery-weui/1.2.1/js/swiper.min.js"></script>
  <script src="//cdn.bootcss.com/jqueryui/1.12.1/jquery-ui.min.js"></script>
  <script type="text/javascript">
    $(function() {

      $('.swiper-container').swiper({
        loop: true,
        autoplay: 5000,
        pagination: '.swiper-pagination',
        paginationClickable: true
      });

    });
  </script>
@stop